API Documentation
ResourceManager.h
1 // ResourceManager.h
3 //
5 
6 namespace nkResources
7 {
22  class ResourceManager final : public nkCommon::SingletonClass<ResourceManager>
23  {
24  public :
25 
26  // About working path
32  void setWorkingPath (const std::string_view& path) ;
38  void setWorkingPathAbsolute (const std::string_view& path) ;
42  const char* getWorkingPath () const ;
46  const char* getWorkingPathAbsolute () const ;
47 
48  // Launch path
52  const char* getLaunchedPath () const ;
58  void setLaunchedPath (const std::string_view& path) ;
59 
60  // Translations
68  std::string getRelativeFromAbsolute (const std::string_view& absolutePath) const ;
76  std::string getAbsoluteFromRelative (const std::string_view& relativePath) const ;
84  std::string getRelativeFromWorkingDir (const std::string_view& workingPath) const ;
92  std::string getAbsoluteFromWorkingDir (const std::string_view& workingPath) const ;
100  std::string getFromWorkingDirFromRelative (const std::string_view& relativePath) const ;
108  std::string getFromWorkingDirFromAbsolute (const std::string_view& absolutePath) const ;
109 
110  // Check folders
118  bool checkFileExists (const std::string_view& filePathAbs) const ;
126  void checkFolderExists (const char* path) ;
127 
128  // Loading
137  nkMemory::Buffer loadFileIntoMemory (const std::string_view& filePathAbs, bool silent = false) ;
138  } ;
139 }
nkResources::ResourceManager::checkFileExists
bool checkFileExists(const std::string_view &filePathAbs) const
nkResources::ResourceManager::loadFileIntoMemory
nkMemory::Buffer loadFileIntoMemory(const std::string_view &filePathAbs, bool silent=false)
nkResources::ResourceManager::getRelativeFromAbsolute
std::string getRelativeFromAbsolute(const std::string_view &absolutePath) const
nkResources::ResourceManager::getAbsoluteFromRelative
std::string getAbsoluteFromRelative(const std::string_view &relativePath) const
nkResources::ResourceManager
Manager helping with path finding and resource loading.
Definition: ResourceManager.h:23
nkResources::ResourceManager::setWorkingPath
void setWorkingPath(const std::string_view &path)
nkResources::ResourceManager::getRelativeFromWorkingDir
std::string getRelativeFromWorkingDir(const std::string_view &workingPath) const
nkResources::ResourceManager::getAbsoluteFromWorkingDir
std::string getAbsoluteFromWorkingDir(const std::string_view &workingPath) const
nkMemory::Buffer
A buffer holding binary data.
Definition: Buffer.h:32
nkResources::ResourceManager::getWorkingPath
const char * getWorkingPath() const
nkResources::ResourceManager::getFromWorkingDirFromAbsolute
std::string getFromWorkingDirFromAbsolute(const std::string_view &absolutePath) const
nkResources::ResourceManager::setWorkingPathAbsolute
void setWorkingPathAbsolute(const std::string_view &path)
nkResources::ResourceManager::checkFolderExists
void checkFolderExists(const char *path)
nkResources::ResourceManager::getLaunchedPath
const char * getLaunchedPath() const
nkResources::ResourceManager::setLaunchedPath
void setLaunchedPath(const std::string_view &path)
nkResources::ResourceManager::getWorkingPathAbsolute
const char * getWorkingPathAbsolute() const
nkResources::ResourceManager::getFromWorkingDirFromRelative
std::string getFromWorkingDirFromRelative(const std::string_view &relativePath) const
nkResources
Encompasses all API of component NilkinsResources.
Definition: LogManager.h:7